<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>外店商品管理</title>
    <!-- Bootstrap 3.3.5 -->
    <link href="http://cdn.52shangou.com/bootstrap/1.0.2/build/3.3.5/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="../../src/c/font-awesome-4.4.0/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="../../src/c/ionicons-2.0.1/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="../../src/c/dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="../../src/c/dist/css/skins/_all-skins.min.css">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <link href="http://cdn.52shangou.com/dataTables/1.0.0/build/dataTables.bootstrap.min.css" rel="stylesheet">
    <link href="http://cdn.52shangou.com/bootstrapvalidator/1.0.0/build/css/bootstrapValidator.min.css"
          rel="stylesheet">
    <link href="http://cdn.52shangou.com/bootstrap-datetimepicker/1.0.0/build/css/bootstrap-datetimepicker.min.css"
          rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="../../build/c/base/index.css">
    <style type="text/css">
        #header-form {
            font-size: 0;
        }

        #header-form .form-group {
            display: inline-block;
            width: 50%;
        }

        #header-form .title {
            text-align: left;
        }

        #header-form .back {
            text-align: right;
        }

        #header-form .back a {
            color: #3c8dbc;
            font-size: 20px;
            text-decoration: underline;
        }

        #spu_area label,
        #spu_area input,
        #spu_area button {
            margin-right: 20px;
        }

        #cached_goods_list {
            margin-top: 10px;
        }

        #shop_area lable {
            margin-right: 30px;
        }

        #shop_area .radio-inline {
            margin-left: 25px;
            margin-bottom: 3px;
        }

        #goods_choose {
            margin-top: 25px;
            font-size: 16px;
        }

        #goods_choose td {
            vertical-align: top;
            padding-left: 8px;
        }

        #goods_input,
        #excel_func {
            margin-top: 15px;
            position: relative;
        }

        #excel_func .excel-upload-btn {
            width: 70px;
            height: 30px;
        }

        #excel_func .excel-upload-input {
            position: absolute;
            width: 70px;
            height: 30px;
            top: 0;
            opacity: 0;
            left: 0;
        }

        #platform label {
            margin-right: 10px;
        }

        #goods_input {
            height: 200px;
        }

        .choosed_goods {
            color: #3bb089;
        }

        #goods_table_wrapper {
            border-top: 1px solid #e2e2e2;
            margin-top: 20px;
        }

        #uploading {
            display: none;
            color: #ff5252;
            height: 30px;
            line-height: 30px;
            margin-bottom: 0;
        }

        #submit,
        #refresh {
            margin-top: 15px;
            width: 95px;
        }
    </style>

</head>
<body class="skin-blue sidebar-mini hold-transition">
<div class="wrapper" style="overflow-x: scroll">
    <header class="main-header">
        <!-- Logo -->
        <a href="../home/index.html" class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><b>C</b>RM</span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg"><b>闪电购</b>CRM</span>
        </a>

        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top" role="navigation">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                <span class="sr-only">导航</span>
            </a>
            <!-- Navbar Right Menu -->
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">


                </ul>
            </div>
        </nav>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar" id="main-sidebar">
    </aside>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <div class="panel panel-default">
                <div class="panel-body">
                    <form role="form" id="header-form">
                        <div class="form-group title">
                            <h3 style="margin: 0;padding-right: 60px">多店铺添加商品</h3>
                        </div>
                        <div class="form-group back">
                            <a href="" id="back">返回</a>
                        </div>
                    </form>
                </div>
            </div>
        </section>
        <!-- Main content -->
        <section class="content">
            <div class="panel panel-default">
                <div class="panel-body">
                    <button class="btn btn-default form-group" id="addGoodsBtn">批量添加SPU</button>
                    <!-- 待导入的商品列表 !-->
                    <div class="table-responsive">
                        <table id="cached_goods_list" class="table table-bordered">
                            <thead>
                            <tr>
                                <th>SPU 名称</th>
                                <th>SPU 规格</th>
                                <th>SPU 单位</th>
                                <th>SPU 条码</th>
                                <th>SPU ID</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                    </div>
                    <!-- 商品导入选择 !-->
                    <table id="goods_choose">
                        <tr>
                            <td><label class="form-group" for="platform">投放平台:</label></td>
                            <td style="padding: 0 35px;">
                                <div id="platform"></div>
                            </td>
                        </tr>
                        <tr>
                            <td id="label"><label for="shop_radio">投放的店铺</label></td>
                            <td style="padding: 0 35px;">
                                <label class="radio-inline" id="shop_radio">
                                    <input type="radio" name="identity" value="全部店铺" checked="checked"/>全部店铺
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="identity" value="用Excel导入"/>用Excel导入
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="identity" value="手动输入店铺"/>手动输入店铺
                                </label>
                                <div id="goods_choose_func" style="display: none;" role="form">
                                    <div id="input_area" class="form-group">
                                            <textarea placeholder="请输入店铺ID,英文逗号分隔" class="form-control"
                                                      name="goods_input"
                                                      id="goods_input"></textarea>
                                    </div>
                                    <div id="excel_func">
                                        <!--<textarea placeholder="已导入的店铺ID" class="form-control"
                                                  name="excel_input"
                                                  id="excel_input"></textarea>!-->
                                        <button class="btn btn-sm btn-default excel-upload-btn" id="excel-upload-btn">上传文件</button>
                                        <input type="file" class="excel-upload-input" id="excel-upload-file">
                                        <button class="btn btn-sm btn-default excel-upload-download"
                                                id="excel-download">下载标准文件
                                        </button>
                                        <label id="uploading">正在上传......</label>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                    <button class="btn btn-sm btn-default" id="refresh">重置</button>
                    <button class="btn btn-sm btn-primary" id="submit">提交</button>
                </div>
            </div>
        </section>
    </div>
    <!-- /.content-wrapper -->

    <footer class="main-footer">

    </footer>

    <!-- Control Sidebar -->


    <!-- /.control-sidebar -->
    <!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>
</div>
<!--商品选择模态框 -->
<div class="modal fade bs-example-modal-lg" tabindex="-1" id="chooseGoods_dialog"
     aria-labelledby="chooseGoods_dialog_title"
     role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="chooseGoods_dialog_title">
                    批量添加SPU
                </h4>
            </div>
            <div class="modal-body" id="chooseGoods_dialog_content">
                <!-- SPU输入 !-->
                <form class="form-inline" id="spu_area">
                    <div class="form-group">
                        <input type="text" class="form-control" id="barcode_input" placeholder="SPU条码">
                    </div>
                    <div class="form-group">
                        <input type="text" class="form-control" id="goodsName_input" placeholder="商品或品牌">
                    </div>
                    <button type="button" class="btn btn-default" id="goods_search_btn">搜索</button>
                </form>
                <!-- 商品列表 !-->
                <table class="table" id="goods_table" style="min-height: 200px;">
                    <tbody>
                    </tbody>
                </table>
                <div class="choosed_goods">
                    <label>已选择SPU : </label>
                    <ul id="choosed_goods_list">

                    </ul>
                </div>
                <button class="btn btn-sm btn-default" onclick="showCachedGoods()">添加SPU</button>
            </div>
        </div>
    </div>
</div>
<!--绑定失败商品展示模态框 -->
<div class="modal fade bs-example-modal-lg" tabindex="-1" id="failedGoods_dialog"
     aria-labelledby="chooseGoods_dialog_title"
     role="dialog" aria-hidden="true" data-backdrop="static">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="failedGoods_dialog_title">
                    失败列表
                </h4>
            </div>
            <div class="modal-body" id="failedGoods_dialog_content">
                <!-- 商品列表 !-->
                <table class="table" id="failedGoods_table" style="min-height: 200px;">
                    <thead>
                    <tr>
                        <td>店铺ID</td>
                        <td>内店名</td>
                        <td>商品SPUID</td>
                        <td>商品名</td>
                        <td>失败原因</td>
                    </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!--确认框 -->
<div class="modal fade bs-example-modal-sm" tabindex="-1" id="confirm_dialog" aria-labelledby="confirm_dialog_title"
     role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="confirm_dialog_title">
                    操作确认
                </h4>
            </div>
            <div class="modal-body" id="confirm_dialog_content"></div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" id="confirm" data-putType="">确 定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关 闭</button>
                <input type="hidden" id="targetCatID">
                <input type="hidden" id="targetItemIDs">
            </div>
        </div>
    </div>
</div>


<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="http://cdn.52shangou.com/jquery/1.0.0/build/jquery-1.11.3.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="http://cdn.52shangou.com/dataTables/1.0.0/build/jquery.dataTables.min.js"></script>
<script src="http://cdn.52shangou.com/bootstrap/1.0.2/build/3.3.5/bootstrap.min.js"></script>
<script src="http://cdn.52shangou.com/dataTables/1.0.0/build/dataTables.bootstrap.min.js"></script>
<script src="http://cdn.52shangou.com/jquery.cookie/1.0.0/build/jquery.cookie.min.js"></script>
<script src="http://cdn.52shangou.com/bootstrap-select/1.0.0/build/js/bootstrap-select.min.js"></script>
<script src="http://cdn.52shangou.com/bootstrapvalidator/1.0.0/build/js/bootstrapValidator.min.js"></script>
<script src="http://cdn.52shangou.com/bootstrap-datetimepicker/1.0.0/build/js/bootstrap-datetimepicker.min.js"></script>
<script src="http://cdn.52shangou.com/bootstrap-datetimepicker/1.0.0/build/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="http://cdn.52shangou.com/bootstrap-typeahead/1.0.2/build/bootstrap-typeahead.min.js"></script>
<script type="text/javascript" src="http://imgdaily01.52shangou.com/js/jquery.ui.widget.js"></script>
<script type="text/javascript" src="http://imgdaily01.52shangou.com/js/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="http://imgdaily01.52shangou.com/js/jquery.fileupload.js"></script>

<!-- AdminLTE App -->
<script src="../../src/c/dist/js/app.min.js"></script>

<!-- main -->
<script type="text/javascript" src="http://cdn.52shangou.com/lib/1.0.1/build/lib/require.js?t=1440237721"></script>
<script type="text/javascript">
    require.config({
        urlArgs: 't=' + (new Date()).getTime(),
        baseUrl: '../../build',
        paths: {
            'juicer': 'http://cdn.52shangou.com/lib/1.0.4/build/lib/juicer-amd'
        }
    });
    require(['p/outflat/addGoods/index']);
</script>
</body>
</html>